# RUN: llvm-mc -triple x86_64 -show-encoding %s | FileCheck %s
# RUN: not llvm-mc -triple i386 -show-encoding %s 2>&1 | FileCheck %s --check-prefix=ERROR

# ERROR-COUNT-94: error:
# ERROR-NOT: error:
# CHECK: {evex}	rolb	$123, %bl
# CHECK: encoding: [0x62,0xf4,0x7c,0x08,0xc0,0xc3,0x7b]
         {evex}	rolb	$123, %bl
# CHECK: {nf}	rolb	$123, %bl
# CHECK: encoding: [0x62,0xf4,0x7c,0x0c,0xc0,0xc3,0x7b]
         {nf}	rolb	$123, %bl
# CHECK: rolb	$123, %bl, %bl
# CHECK: encoding: [0x62,0xf4,0x64,0x18,0xc0,0xc3,0x7b]
         rolb	$123, %bl, %bl
# CHECK: {nf}	rolb	$123, %bl, %bl
# CHECK: encoding: [0x62,0xf4,0x64,0x1c,0xc0,0xc3,0x7b]
         {nf}	rolb	$123, %bl, %bl
# CHECK: {evex}	rolw	$123, %dx
# CHECK: encoding: [0x62,0xf4,0x7d,0x08,0xc1,0xc2,0x7b]
         {evex}	rolw	$123, %dx
# CHECK: {nf}	rolw	$123, %dx
# CHECK: encoding: [0x62,0xf4,0x7d,0x0c,0xc1,0xc2,0x7b]
         {nf}	rolw	$123, %dx
# CHECK: rolw	$123, %dx, %dx
# CHECK: encoding: [0x62,0xf4,0x6d,0x18,0xc1,0xc2,0x7b]
         rolw	$123, %dx, %dx
# CHECK: {nf}	rolw	$123, %dx, %dx
# CHECK: encoding: [0x62,0xf4,0x6d,0x1c,0xc1,0xc2,0x7b]
         {nf}	rolw	$123, %dx, %dx
# CHECK: {evex}	roll	$123, %ecx
# CHECK: encoding: [0x62,0xf4,0x7c,0x08,0xc1,0xc1,0x7b]
         {evex}	roll	$123, %ecx
# CHECK: {nf}	roll	$123, %ecx
# CHECK: encoding: [0x62,0xf4,0x7c,0x0c,0xc1,0xc1,0x7b]
         {nf}	roll	$123, %ecx
# CHECK: roll	$123, %ecx, %ecx
# CHECK: encoding: [0x62,0xf4,0x74,0x18,0xc1,0xc1,0x7b]
         roll	$123, %ecx, %ecx
# CHECK: {nf}	roll	$123, %ecx, %ecx
# CHECK: encoding: [0x62,0xf4,0x74,0x1c,0xc1,0xc1,0x7b]
         {nf}	roll	$123, %ecx, %ecx
# CHECK: {evex}	rolq	$123, %r9
# CHECK: encoding: [0x62,0xd4,0xfc,0x08,0xc1,0xc1,0x7b]
         {evex}	rolq	$123, %r9
# CHECK: {nf}	rolq	$123, %r9
# CHECK: encoding: [0x62,0xd4,0xfc,0x0c,0xc1,0xc1,0x7b]
         {nf}	rolq	$123, %r9
# CHECK: rolq	$123, %r9, %r9
# CHECK: encoding: [0x62,0xd4,0xb4,0x18,0xc1,0xc1,0x7b]
         rolq	$123, %r9, %r9
# CHECK: {nf}	rolq	$123, %r9, %r9
# CHECK: encoding: [0x62,0xd4,0xb4,0x1c,0xc1,0xc1,0x7b]
         {nf}	rolq	$123, %r9, %r9
# CHECK: {evex}	rolb	$123, 291(%r8,%rax,4)
# CHECK: encoding: [0x62,0xd4,0x7c,0x08,0xc0,0x84,0x80,0x23,0x01,0x00,0x00,0x7b]
         {evex}	rolb	$123, 291(%r8,%rax,4)
# CHECK: {nf}	rolb	$123, 291(%r8,%rax,4)
# CHECK: encoding: [0x62,0xd4,0x7c,0x0c,0xc0,0x84,0x80,0x23,0x01,0x00,0x00,0x7b]
         {nf}	rolb	$123, 291(%r8,%rax,4)
# CHECK: rolb	$123, 291(%r8,%rax,4), %bl
# CHECK: encoding: [0x62,0xd4,0x64,0x18,0xc0,0x84,0x80,0x23,0x01,0x00,0x00,0x7b]
         rolb	$123, 291(%r8,%rax,4), %bl
# CHECK: {nf}	rolb	$123, 291(%r8,%rax,4), %bl
# CHECK: encoding: [0x62,0xd4,0x64,0x1c,0xc0,0x84,0x80,0x23,0x01,0x00,0x00,0x7b]
         {nf}	rolb	$123, 291(%r8,%rax,4), %bl
# CHECK: {evex}	rolw	$123, 291(%r8,%rax,4)
# CHECK: encoding: [0x62,0xd4,0x7d,0x08,0xc1,0x84,0x80,0x23,0x01,0x00,0x00,0x7b]
         {evex}	rolw	$123, 291(%r8,%rax,4)
# CHECK: {nf}	rolw	$123, 291(%r8,%rax,4)
# CHECK: encoding: [0x62,0xd4,0x7d,0x0c,0xc1,0x84,0x80,0x23,0x01,0x00,0x00,0x7b]
         {nf}	rolw	$123, 291(%r8,%rax,4)
# CHECK: rolw	$123, 291(%r8,%rax,4), %dx
# CHECK: encoding: [0x62,0xd4,0x6d,0x18,0xc1,0x84,0x80,0x23,0x01,0x00,0x00,0x7b]
         rolw	$123, 291(%r8,%rax,4), %dx
# CHECK: {nf}	rolw	$123, 291(%r8,%rax,4), %dx
# CHECK: encoding: [0x62,0xd4,0x6d,0x1c,0xc1,0x84,0x80,0x23,0x01,0x00,0x00,0x7b]
         {nf}	rolw	$123, 291(%r8,%rax,4), %dx
# CHECK: {evex}	roll	$123, 291(%r8,%rax,4)
# CHECK: encoding: [0x62,0xd4,0x7c,0x08,0xc1,0x84,0x80,0x23,0x01,0x00,0x00,0x7b]
         {evex}	roll	$123, 291(%r8,%rax,4)
# CHECK: {nf}	roll	$123, 291(%r8,%rax,4)
# CHECK: encoding: [0x62,0xd4,0x7c,0x0c,0xc1,0x84,0x80,0x23,0x01,0x00,0x00,0x7b]
         {nf}	roll	$123, 291(%r8,%rax,4)
# CHECK: roll	$123, 291(%r8,%rax,4), %ecx
# CHECK: encoding: [0x62,0xd4,0x74,0x18,0xc1,0x84,0x80,0x23,0x01,0x00,0x00,0x7b]
         roll	$123, 291(%r8,%rax,4), %ecx
# CHECK: {nf}	roll	$123, 291(%r8,%rax,4), %ecx
# CHECK: encoding: [0x62,0xd4,0x74,0x1c,0xc1,0x84,0x80,0x23,0x01,0x00,0x00,0x7b]
         {nf}	roll	$123, 291(%r8,%rax,4), %ecx
# CHECK: {evex}	rolq	$123, 291(%r8,%rax,4)
# CHECK: encoding: [0x62,0xd4,0xfc,0x08,0xc1,0x84,0x80,0x23,0x01,0x00,0x00,0x7b]
         {evex}	rolq	$123, 291(%r8,%rax,4)
# CHECK: {nf}	rolq	$123, 291(%r8,%rax,4)
# CHECK: encoding: [0x62,0xd4,0xfc,0x0c,0xc1,0x84,0x80,0x23,0x01,0x00,0x00,0x7b]
         {nf}	rolq	$123, 291(%r8,%rax,4)
# CHECK: rolq	$123, 291(%r8,%rax,4), %r9
# CHECK: encoding: [0x62,0xd4,0xb4,0x18,0xc1,0x84,0x80,0x23,0x01,0x00,0x00,0x7b]
         rolq	$123, 291(%r8,%rax,4), %r9
# CHECK: {nf}	rolq	$123, 291(%r8,%rax,4), %r9
# CHECK: encoding: [0x62,0xd4,0xb4,0x1c,0xc1,0x84,0x80,0x23,0x01,0x00,0x00,0x7b]
         {nf}	rolq	$123, 291(%r8,%rax,4), %r9
# CHECK: {evex}	rolb	%bl
# CHECK: encoding: [0x62,0xf4,0x7c,0x08,0xd0,0xc3]
         {evex}	rolb	%bl
# CHECK: {nf}	rolb	%bl
# CHECK: encoding: [0x62,0xf4,0x7c,0x0c,0xd0,0xc3]
         {nf}	rolb	%bl
# CHECK: {evex}	rolb	%cl, %bl
# CHECK: encoding: [0x62,0xf4,0x7c,0x08,0xd2,0xc3]
         {evex}	rolb	%cl, %bl
# CHECK: {nf}	rolb	%cl, %bl
# CHECK: encoding: [0x62,0xf4,0x7c,0x0c,0xd2,0xc3]
         {nf}	rolb	%cl, %bl
# CHECK: rolb	%cl, %bl, %bl
# CHECK: encoding: [0x62,0xf4,0x64,0x18,0xd2,0xc3]
         rolb	%cl, %bl, %bl
# CHECK: {nf}	rolb	%cl, %bl, %bl
# CHECK: encoding: [0x62,0xf4,0x64,0x1c,0xd2,0xc3]
         {nf}	rolb	%cl, %bl, %bl
# CHECK: {evex}	rolw	%cl, %dx
# CHECK: encoding: [0x62,0xf4,0x7d,0x08,0xd3,0xc2]
         {evex}	rolw	%cl, %dx
# CHECK: {nf}	rolw	%cl, %dx
# CHECK: encoding: [0x62,0xf4,0x7d,0x0c,0xd3,0xc2]
         {nf}	rolw	%cl, %dx
# CHECK: rolw	%cl, %dx, %dx
# CHECK: encoding: [0x62,0xf4,0x6d,0x18,0xd3,0xc2]
         rolw	%cl, %dx, %dx
# CHECK: {nf}	rolw	%cl, %dx, %dx
# CHECK: encoding: [0x62,0xf4,0x6d,0x1c,0xd3,0xc2]
         {nf}	rolw	%cl, %dx, %dx
# CHECK: {evex}	roll	%cl, %ecx
# CHECK: encoding: [0x62,0xf4,0x7c,0x08,0xd3,0xc1]
         {evex}	roll	%cl, %ecx
# CHECK: {nf}	roll	%cl, %ecx
# CHECK: encoding: [0x62,0xf4,0x7c,0x0c,0xd3,0xc1]
         {nf}	roll	%cl, %ecx
# CHECK: roll	%cl, %ecx, %ecx
# CHECK: encoding: [0x62,0xf4,0x74,0x18,0xd3,0xc1]
         roll	%cl, %ecx, %ecx
# CHECK: {nf}	roll	%cl, %ecx, %ecx
# CHECK: encoding: [0x62,0xf4,0x74,0x1c,0xd3,0xc1]
         {nf}	roll	%cl, %ecx, %ecx
# CHECK: {evex}	rolq	%cl, %r9
# CHECK: encoding: [0x62,0xd4,0xfc,0x08,0xd3,0xc1]
         {evex}	rolq	%cl, %r9
# CHECK: {nf}	rolq	%cl, %r9
# CHECK: encoding: [0x62,0xd4,0xfc,0x0c,0xd3,0xc1]
         {nf}	rolq	%cl, %r9
# CHECK: rolq	%cl, %r9, %r9
# CHECK: encoding: [0x62,0xd4,0xb4,0x18,0xd3,0xc1]
         rolq	%cl, %r9, %r9
# CHECK: {nf}	rolq	%cl, %r9, %r9
# CHECK: encoding: [0x62,0xd4,0xb4,0x1c,0xd3,0xc1]
         {nf}	rolq	%cl, %r9, %r9
# CHECK: {evex}	rolb	%cl, 291(%r8,%rax,4)
# CHECK: encoding: [0x62,0xd4,0x7c,0x08,0xd2,0x84,0x80,0x23,0x01,0x00,0x00]
         {evex}	rolb	%cl, 291(%r8,%rax,4)
# CHECK: {nf}	rolb	%cl, 291(%r8,%rax,4)
# CHECK: encoding: [0x62,0xd4,0x7c,0x0c,0xd2,0x84,0x80,0x23,0x01,0x00,0x00]
         {nf}	rolb	%cl, 291(%r8,%rax,4)
# CHECK: rolb	%cl, 291(%r8,%rax,4), %bl
# CHECK: encoding: [0x62,0xd4,0x64,0x18,0xd2,0x84,0x80,0x23,0x01,0x00,0x00]
         rolb	%cl, 291(%r8,%rax,4), %bl
# CHECK: {nf}	rolb	%cl, 291(%r8,%rax,4), %bl
# CHECK: encoding: [0x62,0xd4,0x64,0x1c,0xd2,0x84,0x80,0x23,0x01,0x00,0x00]
         {nf}	rolb	%cl, 291(%r8,%rax,4), %bl
# CHECK: {evex}	rolw	%cl, 291(%r8,%rax,4)
# CHECK: encoding: [0x62,0xd4,0x7d,0x08,0xd3,0x84,0x80,0x23,0x01,0x00,0x00]
         {evex}	rolw	%cl, 291(%r8,%rax,4)
# CHECK: {nf}	rolw	%cl, 291(%r8,%rax,4)
# CHECK: encoding: [0x62,0xd4,0x7d,0x0c,0xd3,0x84,0x80,0x23,0x01,0x00,0x00]
         {nf}	rolw	%cl, 291(%r8,%rax,4)
# CHECK: rolw	%cl, 291(%r8,%rax,4), %dx
# CHECK: encoding: [0x62,0xd4,0x6d,0x18,0xd3,0x84,0x80,0x23,0x01,0x00,0x00]
         rolw	%cl, 291(%r8,%rax,4), %dx
# CHECK: {nf}	rolw	%cl, 291(%r8,%rax,4), %dx
# CHECK: encoding: [0x62,0xd4,0x6d,0x1c,0xd3,0x84,0x80,0x23,0x01,0x00,0x00]
         {nf}	rolw	%cl, 291(%r8,%rax,4), %dx
# CHECK: {evex}	roll	%cl, 291(%r8,%rax,4)
# CHECK: encoding: [0x62,0xd4,0x7c,0x08,0xd3,0x84,0x80,0x23,0x01,0x00,0x00]
         {evex}	roll	%cl, 291(%r8,%rax,4)
# CHECK: {nf}	roll	%cl, 291(%r8,%rax,4)
# CHECK: encoding: [0x62,0xd4,0x7c,0x0c,0xd3,0x84,0x80,0x23,0x01,0x00,0x00]
         {nf}	roll	%cl, 291(%r8,%rax,4)
# CHECK: roll	%cl, 291(%r8,%rax,4), %ecx
# CHECK: encoding: [0x62,0xd4,0x74,0x18,0xd3,0x84,0x80,0x23,0x01,0x00,0x00]
         roll	%cl, 291(%r8,%rax,4), %ecx
# CHECK: {nf}	roll	%cl, 291(%r8,%rax,4), %ecx
# CHECK: encoding: [0x62,0xd4,0x74,0x1c,0xd3,0x84,0x80,0x23,0x01,0x00,0x00]
         {nf}	roll	%cl, 291(%r8,%rax,4), %ecx
# CHECK: {evex}	rolq	%cl, 291(%r8,%rax,4)
# CHECK: encoding: [0x62,0xd4,0xfc,0x08,0xd3,0x84,0x80,0x23,0x01,0x00,0x00]
         {evex}	rolq	%cl, 291(%r8,%rax,4)
# CHECK: {nf}	rolq	%cl, 291(%r8,%rax,4)
# CHECK: encoding: [0x62,0xd4,0xfc,0x0c,0xd3,0x84,0x80,0x23,0x01,0x00,0x00]
         {nf}	rolq	%cl, 291(%r8,%rax,4)
# CHECK: rolq	%cl, 291(%r8,%rax,4), %r9
# CHECK: encoding: [0x62,0xd4,0xb4,0x18,0xd3,0x84,0x80,0x23,0x01,0x00,0x00]
         rolq	%cl, 291(%r8,%rax,4), %r9
# CHECK: {nf}	rolq	%cl, 291(%r8,%rax,4), %r9
# CHECK: encoding: [0x62,0xd4,0xb4,0x1c,0xd3,0x84,0x80,0x23,0x01,0x00,0x00]
         {nf}	rolq	%cl, 291(%r8,%rax,4), %r9
# CHECK: {evex}	rolw	%dx
# CHECK: encoding: [0x62,0xf4,0x7d,0x08,0xd1,0xc2]
         {evex}	rolw	%dx
# CHECK: {nf}	rolw	%dx
# CHECK: encoding: [0x62,0xf4,0x7d,0x0c,0xd1,0xc2]
         {nf}	rolw	%dx
# CHECK: rolw	%dx, %dx
# CHECK: encoding: [0x62,0xf4,0x6d,0x18,0xd1,0xc2]
         rolw	%dx, %dx
# CHECK: {nf}	rolw	%dx, %dx
# CHECK: encoding: [0x62,0xf4,0x6d,0x1c,0xd1,0xc2]
         {nf}	rolw	%dx, %dx
# CHECK: {evex}	roll	%ecx
# CHECK: encoding: [0x62,0xf4,0x7c,0x08,0xd1,0xc1]
         {evex}	roll	%ecx
# CHECK: {nf}	roll	%ecx
# CHECK: encoding: [0x62,0xf4,0x7c,0x0c,0xd1,0xc1]
         {nf}	roll	%ecx
# CHECK: roll	%ecx, %ecx
# CHECK: encoding: [0x62,0xf4,0x74,0x18,0xd1,0xc1]
         roll	%ecx, %ecx
# CHECK: {nf}	roll	%ecx, %ecx
# CHECK: encoding: [0x62,0xf4,0x74,0x1c,0xd1,0xc1]
         {nf}	roll	%ecx, %ecx
# CHECK: {evex}	rolq	%r9
# CHECK: encoding: [0x62,0xd4,0xfc,0x08,0xd1,0xc1]
         {evex}	rolq	%r9
# CHECK: {nf}	rolq	%r9
# CHECK: encoding: [0x62,0xd4,0xfc,0x0c,0xd1,0xc1]
         {nf}	rolq	%r9
# CHECK: rolq	%r9, %r9
# CHECK: encoding: [0x62,0xd4,0xb4,0x18,0xd1,0xc1]
         rolq	%r9, %r9
# CHECK: {nf}	rolq	%r9, %r9
# CHECK: encoding: [0x62,0xd4,0xb4,0x1c,0xd1,0xc1]
         {nf}	rolq	%r9, %r9
# CHECK: {evex}	rolb	291(%r8,%rax,4)
# CHECK: encoding: [0x62,0xd4,0x7c,0x08,0xd0,0x84,0x80,0x23,0x01,0x00,0x00]
         {evex}	rolb	291(%r8,%rax,4)
# CHECK: {nf}	rolb	291(%r8,%rax,4)
# CHECK: encoding: [0x62,0xd4,0x7c,0x0c,0xd0,0x84,0x80,0x23,0x01,0x00,0x00]
         {nf}	rolb	291(%r8,%rax,4)
# CHECK: rolb	291(%r8,%rax,4), %bl
# CHECK: encoding: [0x62,0xd4,0x64,0x18,0xd0,0x84,0x80,0x23,0x01,0x00,0x00]
         rolb	291(%r8,%rax,4), %bl
# CHECK: {nf}	rolb	291(%r8,%rax,4), %bl
# CHECK: encoding: [0x62,0xd4,0x64,0x1c,0xd0,0x84,0x80,0x23,0x01,0x00,0x00]
         {nf}	rolb	291(%r8,%rax,4), %bl
# CHECK: {evex}	rolw	291(%r8,%rax,4)
# CHECK: encoding: [0x62,0xd4,0x7d,0x08,0xd1,0x84,0x80,0x23,0x01,0x00,0x00]
         {evex}	rolw	291(%r8,%rax,4)
# CHECK: {nf}	rolw	291(%r8,%rax,4)
# CHECK: encoding: [0x62,0xd4,0x7d,0x0c,0xd1,0x84,0x80,0x23,0x01,0x00,0x00]
         {nf}	rolw	291(%r8,%rax,4)
# CHECK: rolw	291(%r8,%rax,4), %dx
# CHECK: encoding: [0x62,0xd4,0x6d,0x18,0xd1,0x84,0x80,0x23,0x01,0x00,0x00]
         rolw	291(%r8,%rax,4), %dx
# CHECK: {nf}	rolw	291(%r8,%rax,4), %dx
# CHECK: encoding: [0x62,0xd4,0x6d,0x1c,0xd1,0x84,0x80,0x23,0x01,0x00,0x00]
         {nf}	rolw	291(%r8,%rax,4), %dx
# CHECK: {evex}	roll	291(%r8,%rax,4)
# CHECK: encoding: [0x62,0xd4,0x7c,0x08,0xd1,0x84,0x80,0x23,0x01,0x00,0x00]
         {evex}	roll	291(%r8,%rax,4)
# CHECK: {nf}	roll	291(%r8,%rax,4)
# CHECK: encoding: [0x62,0xd4,0x7c,0x0c,0xd1,0x84,0x80,0x23,0x01,0x00,0x00]
         {nf}	roll	291(%r8,%rax,4)
# CHECK: roll	291(%r8,%rax,4), %ecx
# CHECK: encoding: [0x62,0xd4,0x74,0x18,0xd1,0x84,0x80,0x23,0x01,0x00,0x00]
         roll	291(%r8,%rax,4), %ecx
# CHECK: {nf}	roll	291(%r8,%rax,4), %ecx
# CHECK: encoding: [0x62,0xd4,0x74,0x1c,0xd1,0x84,0x80,0x23,0x01,0x00,0x00]
         {nf}	roll	291(%r8,%rax,4), %ecx
# CHECK: {evex}	rolq	291(%r8,%rax,4)
# CHECK: encoding: [0x62,0xd4,0xfc,0x08,0xd1,0x84,0x80,0x23,0x01,0x00,0x00]
         {evex}	rolq	291(%r8,%rax,4)
# CHECK: {nf}	rolq	291(%r8,%rax,4)
# CHECK: encoding: [0x62,0xd4,0xfc,0x0c,0xd1,0x84,0x80,0x23,0x01,0x00,0x00]
         {nf}	rolq	291(%r8,%rax,4)
# CHECK: rolq	291(%r8,%rax,4), %r9
# CHECK: encoding: [0x62,0xd4,0xb4,0x18,0xd1,0x84,0x80,0x23,0x01,0x00,0x00]
         rolq	291(%r8,%rax,4), %r9
# CHECK: {nf}	rolq	291(%r8,%rax,4), %r9
# CHECK: encoding: [0x62,0xd4,0xb4,0x1c,0xd1,0x84,0x80,0x23,0x01,0x00,0x00]
         {nf}	rolq	291(%r8,%rax,4), %r9
